<html>
<head><meta charset="utf-8"><title>getcwd shim · t-compiler/const-eval · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/index.html">t-compiler/const-eval</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html">getcwd shim</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="176015600"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176015600" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176015600">(Sep 18 2019 at 15:25)</a>:</h4>
<p>I've been implementing the <code>getcwd</code> shim for miri and I have a few questions about it</p>



<a name="176015754"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176015754" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176015754">(Sep 18 2019 at 15:26)</a>:</h4>
<p>My implementation uses <a href="https://doc.rust-lang.org/std/env/fn.current_dir.html" target="_blank" title="https://doc.rust-lang.org/std/env/fn.current_dir.html">std::env::current_dir</a>, which is the standard library wrapper for  <code>getcwd</code> basically.</p>



<a name="176015924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176015924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176015924">(Sep 18 2019 at 15:28)</a>:</h4>
<p>However, the manipulation of the <code>PathBuf</code> returned by <code>current_dir</code> is platform specific. On windows you can transform that into a <code>Vec&lt;u16&gt;</code> and on linux (And hopefully macos) you transform it into a <code>Vec&lt;u8&gt;</code>. How should I handle this? should I go full <code>cfg!</code> on this?</p>



<a name="176016759"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176016759" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176016759">(Sep 18 2019 at 15:37)</a>:</h4>
<p>oh windows <code>_getcwd</code> should also return an ascii string. there's <code>_wgetcwd</code> for wide strings, so you could <code>pathbuf.display().to_string().bytes()</code> and write those bytes I guess?</p>



<a name="176016899"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176016899" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176016899">(Sep 18 2019 at 15:38)</a>:</h4>
<p>I think it would be a little bit irresponsible for me to implement the windows part without testing it or abusing CI :P</p>



<a name="176016921"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176016921" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176016921">(Sep 18 2019 at 15:39)</a>:</h4>
<p>is it there any chance that a <code>PathBuf</code> might not be "displayable"?</p>



<a name="176017105"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176017105" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176017105">(Sep 18 2019 at 15:41)</a>:</h4>
<p>it may be lossy if the path is not real utf8 I think</p>



<a name="176017139"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176017139" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176017139">(Sep 18 2019 at 15:41)</a>:</h4>
<p>idk, do a best effort thing and we'll wait for someone to complain?</p>



<a name="176017640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176017640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176017640">(Sep 18 2019 at 15:47)</a>:</h4>
<p>Ok I'm going to put a FIXME into the display thing, the std docs aren't clear enough. Apparently <code>display</code> only fails if you lack permissions to see the path metadata<br>
EDIT: wait, It seems i was reading the wrong docs xD<br>
EDIT2: Ok so yeah, the docs don't say anything about that</p>



<a name="176019642"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176019642" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176019642">(Sep 18 2019 at 16:11)</a>:</h4>
<p>I added a comment about that little detail but it works</p>



<a name="176019730"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176019730" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176019730">(Sep 18 2019 at 16:12)</a>:</h4>
<p>so... the next question is, how to test it? We cannot count on anything about the current directory.</p>



<a name="176026969"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176026969" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176026969">(Sep 18 2019 at 17:35)</a>:</h4>
<p>yes we can, the last part must be "miri"</p>



<a name="176026979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176026979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176026979">(Sep 18 2019 at 17:35)</a>:</h4>
<p>(I think)</p>



<a name="176026982"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176026982" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176026982">(Sep 18 2019 at 17:35)</a>:</h4>
<p>oh</p>



<a name="176026983"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176026983" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176026983">(Sep 18 2019 at 17:35)</a>:</h4>
<p>hmm</p>



<a name="176026984"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176026984" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oli <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176026984">(Sep 18 2019 at 17:35)</a>:</h4>
<p>we can't cd</p>



<a name="176031069"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176031069" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176031069">(Sep 18 2019 at 18:17)</a>:</h4>
<p>why miri?</p>



<a name="176031085"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176031085" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176031085">(Sep 18 2019 at 18:17)</a>:</h4>
<p>i mean you can clone it into any directory name, right?</p>



<a name="176034307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176034307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176034307">(Sep 18 2019 at 18:54)</a>:</h4>
<p>:facepalm: i closed the PR by accident, can you reopen it? or should I do another one</p>



<a name="176046304"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046304" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046304">(Sep 18 2019 at 21:02)</a>:</h4>
<blockquote>
<p>:facepalm: i closed the PR by accident, can you reopen it? or should I do another one</p>
</blockquote>
<p>you closed <em>and</em> force-pushed. a capital sin, according to GH. now I can't reopen.</p>



<a name="176046319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046319">(Sep 18 2019 at 21:02)</a>:</h4>
<p>but if you force-push the old commit back in, we cold reopen.</p>



<a name="176046338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046338">(Sep 18 2019 at 21:02)</a>:</h4>
<p>I'm going to change my religion</p>



<a name="176046430"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046430" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046430">(Sep 18 2019 at 21:03)</a>:</h4>
<p>"rust-lang:master is up to date with all commits from christianpoveda:getcwd-shim" what the hell is going on?</p>



<a name="176046434"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046434" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046434">(Sep 18 2019 at 21:03)</a>:</h4>
<blockquote>
<p>so... the next question is, how to test it? We cannot count on anything about the current directory.</p>
</blockquote>
<p>you could, like, <code>.join("tests")</code> and test if a <code>compiletest.rs</code> exists, or so? well hm that's another API that's not implemented</p>



<a name="176046504"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046504" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046504">(Sep 18 2019 at 21:04)</a>:</h4>
<blockquote>
<p>"rust-lang:master is up to date with all commits from christianpoveda:getcwd-shim" what the hell is going on?</p>
</blockquote>
<p>it says so quite clearly? you need to force-push the old thing back into it</p>



<a name="176046508"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046508" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046508">(Sep 18 2019 at 21:04)</a>:</h4>
<p>the one that was there when you closed the PR</p>



<a name="176046533"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046533" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046533">(Sep 18 2019 at 21:04)</a>:</h4>
<p>I guess test it by just calling the function. at least then we know it doesn't ICE or so...</p>



<a name="176046536"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046536" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046536">(Sep 18 2019 at 21:04)</a>:</h4>
<p>wait but... I don't have the old thing</p>



<a name="176046545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046545">(Sep 18 2019 at 21:05)</a>:</h4>
<blockquote>
<p>I guess test it by just calling the function. at least then we know it doesn't ICE or so...</p>
</blockquote>
<p>ok</p>



<a name="176046552"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046552" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046552">(Sep 18 2019 at 21:05)</a>:</h4>
<p>of course you do. git doesnt lose anything.</p>



<a name="176046565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046565">(Sep 18 2019 at 21:05)</a>:</h4>
<p>Ok let me stack-overflow it</p>



<a name="176046570"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046570" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046570">(Sep 18 2019 at 21:05)</a>:</h4>
<p><code>git push christianpoveda ba1fe3e:refs/heads/getcwd-shim -f</code></p>



<a name="176046572"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046572" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046572">(Sep 18 2019 at 21:05)</a>:</h4>
<p>or so</p>



<a name="176046845"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046845" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> RalfJ <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046845">(Sep 18 2019 at 21:08)</a>:</h4>
<p>anyway, I am falling asleep. g'night.</p>



<a name="176046902"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046902" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046902">(Sep 18 2019 at 21:09)</a>:</h4>
<p>So it literally has the old commit somewhere... nice, thank you</p>



<a name="176046930"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176046930" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176046930">(Sep 18 2019 at 21:09)</a>:</h4>
<p>have a good night</p>



<a name="176108914"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176108914" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176108914">(Sep 19 2019 at 15:09)</a>:</h4>
<p>I added a test that just calls <code>get_current_dir</code> and unwraps it</p>



<a name="176109315"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176109315" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176109315">(Sep 19 2019 at 15:13)</a>:</h4>
<p>Oh wait, this should only work if isolation is disabled, right?</p>



<a name="176109676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176109676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176109676">(Sep 19 2019 at 15:17)</a>:</h4>
<p>What should happen here? i suppose one option would be to just error if <code>getcwd</code> is used when isolation is on, other option would be to return a null pointer which is that happens when <code>getcwd</code> according to the manual.</p>



<a name="176111152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/146212-t-compiler/const-eval/topic/getcwd%20shim/near/176111152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Christian Poveda <a href="https://rust-lang.github.io/zulip_archive/stream/146212-t-compiler/const-eval/topic/getcwd.20shim.html#176111152">(Sep 19 2019 at 15:31)</a>:</h4>
<p>I think the first option is less obscure if someone tries to use <code>getcwd</code> with isolation</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>